import {
    center,
    input,
    grid
} from '@/css/DialogsCss.module.scss';
export default {
    title:'新增编辑',
    dialog:{
        size:'50%'
    },
    onMounted: [{
        action:'print',
        value:'$params'
    },{
        action:'set',
        target: '$view',
        field:'title',
        value:'$params.title'
    },{
        action: 'set',
        target: '$widgets.form',
        field: 'value',
        value: '$params.form'
    },{
        action: 'set',
        target: '$widgets.form',
        field: 'value',
        value: '$params.forms'
    }],
    items: [{
        region: 'center',
        layout: 'vertical',
        items: [{
            layout: 'vertical',
            items: [{
                class: center,
                id: 'form',
                widget: 'form',
                layout: {
                    type:'gridform',
                    column:2
                },
                fields:[{
                    class: input,
                    itemId:'name',
                    placeholder:'请输入客户名称(公司)',
                    widget:'text',
                    label:'客户名称',
                },{
                    class: input,
                    itemId:'category_uuid',
                    placeholder:'请选择客户分类',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'crm_customer_category',
                        },
                    },
                    label:'客户分类',
                },{
                    class: input,
                    itemId:'industry_uuid',
                    placeholder:'请选择所属行业',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'crm_customer_industry',
                        },
                    },
                    label:'所属行业',
                },{
                    class: input,
                    itemId:'source_uuid',
                    placeholder:'请选择客户来源',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'crm_customer_source',
                        },
                    },
                    label:'客户来源',
                },{
                    class: input,
                    itemId:'status_uuid',
                    placeholder:'请选择客户状态',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'crm_customer_status',
                        },
                    },
                    label:'客户状态',
                },{
                    class: input,
                    itemId:'level_uuid',
                    placeholder:'请选择客户等级',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'crm_customer_level',
                        },
                    },
                    label:'客户等级',
                },{
                    class: input,
                    itemId:'stage_uuid',
                    placeholder:'请选择当前阶段',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'crm_sale_stage',
                        },
                    },
                    label:'当前阶段',
                },{
                    class: input,
                    itemId:'label_uuid',
                    placeholder:'请选择客户标签',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'crm_customer_label',
                        },
                    },
                    label:'客户标签',
                }],
            },{
                class: [center, grid],
                id: 'forms',
                widget: 'form',
                layout: {
                    type:'gridform',
                    column:2
                },
                fields:[{
                    class: input,
                    itemId:'salesman',
                    placeholder:'请输入销售联系人',
                    widget:'text',
                    label:'销售联系人',
                },{
                    class: input,
                    itemId:'contact',
                    placeholder:'请输入客户联系人',
                    widget:'text',
                    label:'客户联系人',
                },{
                    class: input,
                    itemId:'phone',
                    placeholder:'请输入手机号码',
                    widget:'text',
                    label:'手机号码',
                },{
                    class: input,
                    itemId:'qq',
                    placeholder:'请输入QQ',
                    widget:'text',
                    label:'QQ号码',
                },{
                    class: input,
                    itemId:'wechat',
                    placeholder:'请输入微信',
                    widget:'text',
                    label:'微信号码',
                },{
                    class: input,
                    itemId:'remarks',
                    placeholder:'请输入备注说明',
                    widget:'text',
                    label:'备注说明',
                }],
                buttons: [{
                    value: '保存',
                    type: 'primary',
                    onClick: [{
                        action: 'confirm',
                        title: '表单保存',
                        message: '是否保存表单?',
                        confirm: [{
                            var:'value',
                            target:'$widget.form',
                            action:'call',
                            method:'getValue'
                       },{
                            action: 'service',
                            path: 'crm/customer/save',
                            params: '$vars.value'
                        },{
                            action:'dialog-hide',
                            mode:'apply'
                        }]
                    }]
                }],
            }]
        }]
    }]
};


